package org.mall.modules.pojo.product.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.mall.common.util.jsonschema.Long2StringSerializer;
import org.mall.common.util.jsonschema.String2LongDeserialize;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMin;
import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 商品SPU
 * @Author: jeecg-boot
 * @Date:   2019-11-22
 * @Version: V1.0
 */
@Data
@Accessors(chain = true)
public class CommoditySpuDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**状态(true上架，false下架)*/
    @Excel(name = "状态(true上架，false下架)", width = 15)
    private Boolean visible;
    /**品牌ID*/
    private String brandId;
    /**副标题*/
    private String caption;
    /**三级类目*/
    @Excel(name = "三级类目", width = 15)
    private String categoryId;
    /**三级类目名称*/
    @Excel(name = "三级类目名称", width = 15)
    private String categoryName;
    /**分类编号*/
    private Integer cid;
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**默认SKU*/
    private String defaultItemId;
    /**是否删除*/
    @Excel(name = "是否删除（0;未删除，1：删除）", width = 15)
    private Boolean deleted;
    /**描述*/
    private String description;
    /**SPU 编号*/
    @JsonDeserialize(using = String2LongDeserialize.class)
    @JsonSerialize(using = Long2StringSerializer.class)
    private Long id;

    /**是否启用规格*/
    private String isEnableSpec;
    /**SPU 名字*/
    private String name;
    /**商品主图地址
     *
     * 数组，以逗号分隔
     *
     * 建议尺寸：800*800像素，你可以拖拽图片调整顺序，最多上传15张1*/
    private String picUrls;
    /**价格*/
    private Integer price;
    /**库存数量*/
    private Integer quantity;
    /**卖点*/
    private String sellPoint;
    /**商家ID*/
    private String sellerId;
    /**店铺_id*/
    private String shopId;
    private String shopName;
    /**排序字段*/
    private Integer sort;
    /**模板类型ID（待用）*/
    private String templateTypeId;
    /**审核（0：待审核。1审核通过）*/
    private String toExamine;
    /**最后更新时间*/
    private Date updateTime;

    private String upperLowerFlag;
    /**商品现价，单位：元*/
    @Excel(name = "商品现价格，单位：元", width = 15)
    @DecimalMin(value = "0",message = "商品价格不能小于0")
    private Integer presentPrice;
}
